<template>
  <div class="main">
    <div class="banner flex">
      <img src="@/assets/img-demand.jpg">
    </div>

    <div class="wrap">
      <div class="btns flex">
        <p class="font-14 pointer" @click="toAdd">提交网红需求</p>
      </div>
      <el-table :data="tableData" style="width: 100%;" class="table">
        <el-table-column prop="value" label="提交时间" />
        <el-table-column prop="value" label="需求线索编号" />
        <el-table-column prop="value" label="需求线索名称" />
        <el-table-column prop="value" label="需求线索状态" />
        <el-table-column label="操作" fixed="right" width="124">
          <template #default="scope">
            <div class="row-btns flex flex-align-items-center">
              <p class="row-btn font-14 pointer" @click="toDetail(scope.row)">详情</p>
              <span class="line"></span>
              <p class="row-btn font-14 pointer" @click="toEdit(scope.row)">编辑</p>
            </div>
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination flex flex-align-items-center">
        <el-pagination layout="prev, pager, next, total" :total="form.total" />
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import api from '@/api/index.js';
import { useRouter } from 'vue-router';

const router = useRouter();

const form = ref({
  page: 1,
  perPage: 10,
  total: 1
});
const tableData = ref([]);

const toAdd = () => {
  router.push('/addDemand');
}
</script>

<style lang="less" scoped>
.main {
  padding: 16px;
}

.banner {
  margin-bottom: 16px;

  img {
    width: 100%;
  }
}

.wrap {
  padding: 16px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);

  .btns {
    margin-bottom: 16px;

    p {
      min-width: 70px;
      padding: 0 8px;
      height: 32px;
      border-radius: 2px;
      background: @main-color !important;
      color: #fff;
      line-height: 32px;
    }
  }

  .table {
    &::v-deep {
      .el-table__empty-block {
        height: 500px !important;
      }
    }
  }

  .pagination {
    justify-content: end;
    margin-top: 16px;
  }
}
</style>
